/*
 * Copyright (c) 2006-2021, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2025-02-27     liyih       the first version
 */
#ifndef APPLICATIONS_AD9910_AD9910_RAM_HPP_
#define APPLICATIONS_AD9910_AD9910_RAM_HPP_

#include <AD9910/AD9910_Base.hpp>
#include <vector>

typedef std::vector<uint8_t> profile_t;
typedef std::vector<uint32_t> ram_data_t;

enum class RAM_MODE : uint8_t
{
    DirtSwitch = 0b000,  // 直接转换模式
    RampUp = 0b001,      // 上斜坡模式
    BidRamp = 0b010,     // 双向斜坡模式
    ContBidRamp = 0b011, // 连续双向斜坡模式
    ContReCirc = 0b100   // 连续循环模式
};

class AD9910_RAM : public AD9910_Base
{
public:
    AD9910_RAM();
    virtual ~AD9910_RAM();

    void setDefaultCFR() override;

    profile_t genRamProfile(uint16_t addrStepRate,
                            uint16_t endAddr = 1023,
                            uint16_t startAddr = 0,
                            RAM_MODE ramMode = RAM_MODE::ContReCirc);
    void setRAM_Enable(bool enable = true);
    void setWave(const profile_t &profile, const std::vector<uint32_t> &dataVec);
    void setProfileCtrlMode(uint8_t endProfile = 7, bool continuous = true, bool enable = false);
    void writeProfile(const profile_t &profile, const uint8_t profileIndex = 0);
    void writeRAM(const ram_data_t &dataVec);
    ram_data_t readRAM();

private:
    profile_t ram_profile;

public:
    const std::vector<uint32_t> ALL_HIGH = std::vector<uint32_t>(1024, 16383);
    const std::vector<uint32_t> ALL_LOW = std::vector<uint32_t>(1024, 0);

    const std::vector<uint32_t> TRIANGLE_WAVE =
        {
            0,
            31,
            63,
            95,
            127,
            159,
            191,
            223,
            255,
            287,
            319,
            351,
            383,
            415,
            447,
            479,
            511,
            543,
            575,
            607,
            639,
            671,
            703,
            735,
            767,
            799,
            831,
            863,
            895,
            927,
            959,
            991,
            1023,
            1055,
            1087,
            1119,
            1151,
            1183,
            1215,
            1247,
            1279,
            1311,
            1343,
            1375,
            1407,
            1439,
            1471,
            1503,
            1535,
            1567,
            1599,
            1631,
            1663,
            1695,
            1727,
            1759,
            1791,
            1823,
            1855,
            1887,
            1919,
            1951,
            1983,
            2015,
            2047,
            2079,
            2111,
            2143,
            2175,
            2207,
            2239,
            2271,
            2303,
            2335,
            2367,
            2399,
            2431,
            2463,
            2495,
            2527,
            2559,
            2591,
            2623,
            2655,
            2687,
            2719,
            2751,
            2783,
            2815,
            2847,
            2879,
            2911,
            2943,
            2975,
            3007,
            3039,
            3071,
            3103,
            3135,
            3167,
            3199,
            3231,
            3263,
            3295,
            3327,
            3359,
            3391,
            3423,
            3455,
            3487,
            3519,
            3551,
            3583,
            3615,
            3647,
            3679,
            3711,
            3743,
            3775,
            3807,
            3839,
            3871,
            3903,
            3935,
            3967,
            3999,
            4031,
            4063,
            4095,
            4127,
            4159,
            4191,
            4223,
            4255,
            4287,
            4319,
            4351,
            4383,
            4415,
            4447,
            4479,
            4511,
            4543,
            4575,
            4607,
            4639,
            4671,
            4703,
            4735,
            4767,
            4799,
            4831,
            4863,
            4895,
            4927,
            4959,
            4991,
            5023,
            5055,
            5087,
            5119,
            5151,
            5183,
            5215,
            5247,
            5279,
            5311,
            5343,
            5375,
            5407,
            5439,
            5471,
            5503,
            5535,
            5567,
            5599,
            5631,
            5663,
            5695,
            5727,
            5759,
            5791,
            5823,
            5855,
            5887,
            5919,
            5951,
            5983,
            6015,
            6047,
            6079,
            6111,
            6143,
            6175,
            6207,
            6239,
            6271,
            6303,
            6335,
            6367,
            6399,
            6431,
            6463,
            6495,
            6527,
            6559,
            6591,
            6623,
            6655,
            6687,
            6719,
            6751,
            6783,
            6815,
            6847,
            6879,
            6911,
            6943,
            6975,
            7007,
            7039,
            7071,
            7103,
            7135,
            7167,
            7199,
            7231,
            7263,
            7295,
            7327,
            7359,
            7391,
            7423,
            7455,
            7487,
            7519,
            7551,
            7583,
            7615,
            7647,
            7679,
            7711,
            7743,
            7775,
            7807,
            7839,
            7871,
            7903,
            7935,
            7967,
            7999,
            8031,
            8063,
            8095,
            8127,
            8159,
            8191,
            8223,
            8255,
            8287,
            8319,
            8351,
            8383,
            8415,
            8447,
            8479,
            8511,
            8543,
            8575,
            8607,
            8639,
            8671,
            8703,
            8735,
            8767,
            8799,
            8831,
            8863,
            8895,
            8927,
            8959,
            8991,
            9023,
            9055,
            9087,
            9119,
            9151,
            9183,
            9215,
            9247,
            9279,
            9311,
            9343,
            9375,
            9407,
            9439,
            9471,
            9503,
            9535,
            9567,
            9599,
            9631,
            9663,
            9695,
            9727,
            9759,
            9791,
            9823,
            9855,
            9887,
            9919,
            9951,
            9983,
            10015,
            10047,
            10079,
            10111,
            10143,
            10175,
            10207,
            10239,
            10271,
            10303,
            10335,
            10367,
            10399,
            10431,
            10463,
            10495,
            10527,
            10559,
            10591,
            10623,
            10655,
            10687,
            10719,
            10751,
            10783,
            10815,
            10847,
            10879,
            10911,
            10943,
            10975,
            11007,
            11039,
            11071,
            11103,
            11135,
            11167,
            11199,
            11231,
            11263,
            11295,
            11327,
            11359,
            11391,
            11423,
            11455,
            11487,
            11519,
            11551,
            11583,
            11615,
            11647,
            11679,
            11711,
            11743,
            11775,
            11807,
            11839,
            11871,
            11903,
            11935,
            11967,
            11999,
            12031,
            12063,
            12095,
            12127,
            12159,
            12191,
            12223,
            12255,
            12287,
            12319,
            12351,
            12383,
            12415,
            12447,
            12479,
            12511,
            12543,
            12575,
            12607,
            12639,
            12671,
            12703,
            12735,
            12767,
            12799,
            12831,
            12863,
            12895,
            12927,
            12959,
            12991,
            13023,
            13055,
            13087,
            13119,
            13151,
            13183,
            13215,
            13247,
            13279,
            13311,
            13343,
            13375,
            13407,
            13439,
            13471,
            13503,
            13535,
            13567,
            13599,
            13631,
            13663,
            13695,
            13727,
            13759,
            13791,
            13823,
            13855,
            13887,
            13919,
            13951,
            13983,
            14015,
            14047,
            14079,
            14111,
            14143,
            14175,
            14207,
            14239,
            14271,
            14303,
            14335,
            14367,
            14399,
            14431,
            14463,
            14495,
            14527,
            14559,
            14591,
            14623,
            14655,
            14687,
            14719,
            14751,
            14783,
            14815,
            14847,
            14879,
            14911,
            14943,
            14975,
            15007,
            15039,
            15071,
            15103,
            15135,
            15167,
            15199,
            15231,
            15263,
            15295,
            15327,
            15359,
            15391,
            15423,
            15455,
            15487,
            15519,
            15551,
            15583,
            15615,
            15647,
            15679,
            15711,
            15743,
            15775,
            15807,
            15839,
            15871,
            15903,
            15935,
            15967,
            15999,
            16031,
            16063,
            16095,
            16127,
            16159,
            16191,
            16223,
            16255,
            16287,
            16319,
            16351,
            16351,
            16319,
            16287,
            16255,
            16223,
            16191,
            16159,
            16127,
            16095,
            16063,
            16031,
            15999,
            15967,
            15935,
            15903,
            15871,
            15839,
            15807,
            15775,
            15743,
            15711,
            15679,
            15647,
            15615,
            15583,
            15551,
            15519,
            15487,
            15455,
            15423,
            15391,
            15359,
            15327,
            15295,
            15263,
            15231,
            15199,
            15167,
            15135,
            15103,
            15071,
            15039,
            15007,
            14975,
            14943,
            14911,
            14879,
            14847,
            14815,
            14783,
            14751,
            14719,
            14687,
            14655,
            14623,
            14591,
            14559,
            14527,
            14495,
            14463,
            14431,
            14399,
            14367,
            14335,
            14303,
            14271,
            14239,
            14207,
            14175,
            14143,
            14111,
            14079,
            14047,
            14015,
            13983,
            13951,
            13919,
            13887,
            13855,
            13823,
            13791,
            13759,
            13727,
            13695,
            13663,
            13631,
            13599,
            13567,
            13535,
            13503,
            13471,
            13439,
            13407,
            13375,
            13343,
            13311,
            13279,
            13247,
            13215,
            13183,
            13151,
            13119,
            13087,
            13055,
            13023,
            12991,
            12959,
            12927,
            12895,
            12863,
            12831,
            12799,
            12767,
            12735,
            12703,
            12671,
            12639,
            12607,
            12575,
            12543,
            12511,
            12479,
            12447,
            12415,
            12383,
            12351,
            12319,
            12287,
            12255,
            12223,
            12191,
            12159,
            12127,
            12095,
            12063,
            12031,
            11999,
            11967,
            11935,
            11903,
            11871,
            11839,
            11807,
            11775,
            11743,
            11711,
            11679,
            11647,
            11615,
            11583,
            11551,
            11519,
            11487,
            11455,
            11423,
            11391,
            11359,
            11327,
            11295,
            11263,
            11231,
            11199,
            11167,
            11135,
            11103,
            11071,
            11039,
            11007,
            10975,
            10943,
            10911,
            10879,
            10847,
            10815,
            10783,
            10751,
            10719,
            10687,
            10655,
            10623,
            10591,
            10559,
            10527,
            10495,
            10463,
            10431,
            10399,
            10367,
            10335,
            10303,
            10271,
            10239,
            10207,
            10175,
            10143,
            10111,
            10079,
            10047,
            10015,
            9983,
            9951,
            9919,
            9887,
            9855,
            9823,
            9791,
            9759,
            9727,
            9695,
            9663,
            9631,
            9599,
            9567,
            9535,
            9503,
            9471,
            9439,
            9407,
            9375,
            9343,
            9311,
            9279,
            9247,
            9215,
            9183,
            9151,
            9119,
            9087,
            9055,
            9023,
            8991,
            8959,
            8927,
            8895,
            8863,
            8831,
            8799,
            8767,
            8735,
            8703,
            8671,
            8639,
            8607,
            8575,
            8543,
            8511,
            8479,
            8447,
            8415,
            8383,
            8351,
            8319,
            8287,
            8255,
            8223,
            8191,
            8159,
            8127,
            8095,
            8063,
            8031,
            7999,
            7967,
            7935,
            7903,
            7871,
            7839,
            7807,
            7775,
            7743,
            7711,
            7679,
            7647,
            7615,
            7583,
            7551,
            7519,
            7487,
            7455,
            7423,
            7391,
            7359,
            7327,
            7295,
            7263,
            7231,
            7199,
            7167,
            7135,
            7103,
            7071,
            7039,
            7007,
            6975,
            6943,
            6911,
            6879,
            6847,
            6815,
            6783,
            6751,
            6719,
            6687,
            6655,
            6623,
            6591,
            6559,
            6527,
            6495,
            6463,
            6431,
            6399,
            6367,
            6335,
            6303,
            6271,
            6239,
            6207,
            6175,
            6143,
            6111,
            6079,
            6047,
            6015,
            5983,
            5951,
            5919,
            5887,
            5855,
            5823,
            5791,
            5759,
            5727,
            5695,
            5663,
            5631,
            5599,
            5567,
            5535,
            5503,
            5471,
            5439,
            5407,
            5375,
            5343,
            5311,
            5279,
            5247,
            5215,
            5183,
            5151,
            5119,
            5087,
            5055,
            5023,
            4991,
            4959,
            4927,
            4895,
            4863,
            4831,
            4799,
            4767,
            4735,
            4703,
            4671,
            4639,
            4607,
            4575,
            4543,
            4511,
            4479,
            4447,
            4415,
            4383,
            4351,
            4319,
            4287,
            4255,
            4223,
            4191,
            4159,
            4127,
            4095,
            4063,
            4031,
            3999,
            3967,
            3935,
            3903,
            3871,
            3839,
            3807,
            3775,
            3743,
            3711,
            3679,
            3647,
            3615,
            3583,
            3551,
            3519,
            3487,
            3455,
            3423,
            3391,
            3359,
            3327,
            3295,
            3263,
            3231,
            3199,
            3167,
            3135,
            3103,
            3071,
            3039,
            3007,
            2975,
            2943,
            2911,
            2879,
            2847,
            2815,
            2783,
            2751,
            2719,
            2687,
            2655,
            2623,
            2591,
            2559,
            2527,
            2495,
            2463,
            2431,
            2399,
            2367,
            2335,
            2303,
            2271,
            2239,
            2207,
            2175,
            2143,
            2111,
            2079,
            2047,
            2015,
            1983,
            1951,
            1919,
            1887,
            1855,
            1823,
            1791,
            1759,
            1727,
            1695,
            1663,
            1631,
            1599,
            1567,
            1535,
            1503,
            1471,
            1439,
            1407,
            1375,
            1343,
            1311,
            1279,
            1247,
            1215,
            1183,
            1151,
            1119,
            1087,
            1055,
            1023,
            991,
            959,
            927,
            895,
            863,
            831,
            799,
            767,
            735,
            703,
            671,
            639,
            607,
            575,
            543,
            511,
            479,
            447,
            415,
            383,
            351,
            319,
            287,
            255,
            223,
            191,
            159,
            127,
            95,
            63,
            31,
            0,
        };

    const std::vector<uint32_t> SQUARE_WAVE =
        {
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
            16383,
        };

    const std::vector<uint32_t> SINC_WAVE =
        {
            2924,
            2897,
            2871,
            2844,
            2818,
            2792,
            2766,
            2740,
            2715,
            2690,
            2666,
            2642,
            2619,
            2596,
            2574,
            2553,
            2532,
            2513,
            2494,
            2476,
            2460,
            2444,
            2430,
            2416,
            2404,
            2393,
            2383,
            2375,
            2368,
            2362,
            2357,
            2354,
            2352,
            2352,
            2353,
            2355,
            2359,
            2364,
            2370,
            2378,
            2387,
            2398,
            2409,
            2423,
            2437,
            2453,
            2469,
            2487,
            2507,
            2527,
            2548,
            2570,
            2594,
            2618,
            2643,
            2668,
            2695,
            2722,
            2750,
            2778,
            2807,
            2836,
            2866,
            2895,
            2925,
            2956,
            2986,
            3016,
            3046,
            3076,
            3106,
            3135,
            3164,
            3193,
            3221,
            3248,
            3275,
            3301,
            3326,
            3351,
            3374,
            3397,
            3418,
            3439,
            3458,
            3476,
            3493,
            3508,
            3522,
            3535,
            3546,
            3556,
            3565,
            3571,
            3577,
            3581,
            3583,
            3583,
            3583,
            3580,
            3576,
            3570,
            3563,
            3554,
            3543,
            3531,
            3518,
            3503,
            3486,
            3468,
            3449,
            3428,
            3406,
            3382,
            3358,
            3332,
            3305,
            3277,
            3248,
            3218,
            3188,
            3156,
            3124,
            3091,
            3057,
            3023,
            2989,
            2954,
            2919,
            2884,
            2849,
            2813,
            2778,
            2743,
            2708,
            2674,
            2640,
            2606,
            2574,
            2541,
            2510,
            2479,
            2449,
            2421,
            2393,
            2366,
            2341,
            2317,
            2294,
            2273,
            2253,
            2234,
            2217,
            2202,
            2189,
            2177,
            2167,
            2158,
            2152,
            2147,
            2144,
            2143,
            2144,
            2147,
            2152,
            2158,
            2167,
            2177,
            2189,
            2203,
            2219,
            2237,
            2256,
            2278,
            2300,
            2325,
            2351,
            2379,
            2408,
            2438,
            2470,
            2504,
            2538,
            2574,
            2610,
            2648,
            2686,
            2726,
            2766,
            2807,
            2848,
            2889,
            2931,
            2974,
            3016,
            3059,
            3101,
            3143,
            3185,
            3227,
            3268,
            3308,
            3348,
            3387,
            3426,
            3463,
            3499,
            3534,
            3568,
            3601,
            3632,
            3661,
            3689,
            3715,
            3740,
            3763,
            3784,
            3803,
            3819,
            3834,
            3847,
            3858,
            3866,
            3872,
            3876,
            3878,
            3877,
            3874,
            3869,
            3862,
            3852,
            3839,
            3825,
            3808,
            3789,
            3768,
            3744,
            3718,
            3690,
            3661,
            3629,
            3595,
            3559,
            3522,
            3482,
            3442,
            3399,
            3355,
            3310,
            3263,
            3216,
            3167,
            3117,
            3066,
            3015,
            2963,
            2910,
            2857,
            2804,
            2751,
            2698,
            2645,
            2592,
            2539,
            2487,
            2436,
            2385,
            2335,
            2287,
            2239,
            2193,
            2148,
            2104,
            2062,
            2022,
            1984,
            1948,
            1914,
            1882,
            1852,
            1824,
            1799,
            1777,
            1757,
            1739,
            1725,
            1713,
            1704,
            1698,
            1695,
            1695,
            1697,
            1703,
            1712,
            1724,
            1738,
            1756,
            1777,
            1801,
            1827,
            1857,
            1890,
            1925,
            1963,
            2004,
            2047,
            2093,
            2141,
            2192,
            2245,
            2301,
            2358,
            2417,
            2478,
            2541,
            2605,
            2671,
            2738,
            2806,
            2875,
            2945,
            3016,
            3087,
            3159,
            3231,
            3303,
            3374,
            3446,
            3516,
            3587,
            3656,
            3724,
            3792,
            3857,
            3922,
            3984,
            4045,
            4104,
            4160,
            4214,
            4266,
            4315,
            4361,
            4404,
            4445,
            4482,
            4515,
            4545,
            4572,
            4595,
            4614,
            4629,
            4641,
            4648,
            4651,
            4650,
            4645,
            4636,
            4622,
            4604,
            4582,
            4555,
            4524,
            4489,
            4450,
            4406,
            4358,
            4306,
            4249,
            4189,
            4125,
            4057,
            3985,
            3910,
            3831,
            3749,
            3663,
            3575,
            3483,
            3389,
            3293,
            3194,
            3092,
            2989,
            2884,
            2777,
            2669,
            2560,
            2450,
            2340,
            2229,
            2118,
            2007,
            1896,
            1786,
            1677,
            1569,
            1462,
            1357,
            1254,
            1153,
            1055,
            959,
            867,
            778,
            692,
            610,
            532,
            459,
            390,
            326,
            267,
            213,
            165,
            122,
            86,
            56,
            32,
            14,
            3,
            0,
            3,
            13,
            31,
            56,
            89,
            129,
            178,
            234,
            298,
            370,
            450,
            538,
            634,
            738,
            851,
            971,
            1100,
            1236,
            1380,
            1532,
            1692,
            1860,
            2034,
            2217,
            2406,
            2603,
            2806,
            3016,
            3233,
            3456,
            3685,
            3919,
            4160,
            4405,
            4656,
            4912,
            5172,
            5436,
            5704,
            5976,
            6251,
            6528,
            6809,
            7091,
            7376,
            7662,
            7949,
            8237,
            8525,
            8814,
            9102,
            9389,
            9676,
            9961,
            10244,
            10524,
            10803,
            11078,
            11350,
            11618,
            11882,
            12142,
            12396,
            12646,
            12890,
            13128,
            13360,
            13586,
            13805,
            14016,
            14220,
            14417,
            14605,
            14785,
            14957,
            15120,
            15274,
            15418,
            15553,
            15679,
            15795,
            15900,
            15996,
            16081,
            16156,
            16221,
            16274,
            16318,
            16350,
            16372,
            16383,
            16383,
            16372,
            16350,
            16318,
            16274,
            16221,
            16156,
            16081,
            15996,
            15900,
            15795,
            15679,
            15553,
            15418,
            15274,
            15120,
            14957,
            14785,
            14605,
            14417,
            14220,
            14016,
            13805,
            13586,
            13360,
            13128,
            12890,
            12646,
            12396,
            12142,
            11882,
            11618,
            11350,
            11078,
            10803,
            10524,
            10244,
            9961,
            9676,
            9389,
            9102,
            8814,
            8525,
            8237,
            7949,
            7662,
            7376,
            7091,
            6809,
            6528,
            6251,
            5976,
            5704,
            5436,
            5172,
            4912,
            4656,
            4405,
            4160,
            3919,
            3685,
            3456,
            3233,
            3016,
            2806,
            2603,
            2406,
            2217,
            2034,
            1860,
            1692,
            1532,
            1380,
            1236,
            1100,
            971,
            851,
            738,
            634,
            538,
            450,
            370,
            298,
            234,
            178,
            129,
            89,
            56,
            31,
            13,
            3,
            0,
            3,
            14,
            32,
            56,
            86,
            122,
            165,
            213,
            267,
            326,
            390,
            459,
            532,
            610,
            692,
            778,
            867,
            959,
            1055,
            1153,
            1254,
            1357,
            1462,
            1569,
            1677,
            1786,
            1896,
            2007,
            2118,
            2229,
            2340,
            2450,
            2560,
            2669,
            2777,
            2884,
            2989,
            3092,
            3194,
            3293,
            3389,
            3483,
            3575,
            3663,
            3749,
            3831,
            3910,
            3985,
            4057,
            4125,
            4189,
            4249,
            4306,
            4358,
            4406,
            4450,
            4489,
            4524,
            4555,
            4582,
            4604,
            4622,
            4636,
            4645,
            4650,
            4651,
            4648,
            4641,
            4629,
            4614,
            4595,
            4572,
            4545,
            4515,
            4482,
            4445,
            4404,
            4361,
            4315,
            4266,
            4214,
            4160,
            4104,
            4045,
            3984,
            3922,
            3857,
            3792,
            3724,
            3656,
            3587,
            3516,
            3446,
            3374,
            3303,
            3231,
            3159,
            3087,
            3016,
            2945,
            2875,
            2806,
            2738,
            2671,
            2605,
            2541,
            2478,
            2417,
            2358,
            2301,
            2245,
            2192,
            2141,
            2093,
            2047,
            2004,
            1963,
            1925,
            1890,
            1857,
            1827,
            1801,
            1777,
            1756,
            1738,
            1724,
            1712,
            1703,
            1697,
            1695,
            1695,
            1698,
            1704,
            1713,
            1725,
            1739,
            1757,
            1777,
            1799,
            1824,
            1852,
            1882,
            1914,
            1948,
            1984,
            2022,
            2062,
            2104,
            2148,
            2193,
            2239,
            2287,
            2335,
            2385,
            2436,
            2487,
            2539,
            2592,
            2645,
            2698,
            2751,
            2804,
            2857,
            2910,
            2963,
            3015,
            3066,
            3117,
            3167,
            3216,
            3263,
            3310,
            3355,
            3399,
            3442,
            3482,
            3522,
            3559,
            3595,
            3629,
            3661,
            3690,
            3718,
            3744,
            3768,
            3789,
            3808,
            3825,
            3839,
            3852,
            3862,
            3869,
            3874,
            3877,
            3878,
            3876,
            3872,
            3866,
            3858,
            3847,
            3834,
            3819,
            3803,
            3784,
            3763,
            3740,
            3715,
            3689,
            3661,
            3632,
            3601,
            3568,
            3534,
            3499,
            3463,
            3426,
            3387,
            3348,
            3308,
            3268,
            3227,
            3185,
            3143,
            3101,
            3059,
            3016,
            2974,
            2931,
            2889,
            2848,
            2807,
            2766,
            2726,
            2686,
            2648,
            2610,
            2574,
            2538,
            2504,
            2470,
            2438,
            2408,
            2379,
            2351,
            2325,
            2300,
            2278,
            2256,
            2237,
            2219,
            2203,
            2189,
            2177,
            2167,
            2158,
            2152,
            2147,
            2144,
            2143,
            2144,
            2147,
            2152,
            2158,
            2167,
            2177,
            2189,
            2202,
            2217,
            2234,
            2253,
            2273,
            2294,
            2317,
            2341,
            2366,
            2393,
            2421,
            2449,
            2479,
            2510,
            2541,
            2574,
            2606,
            2640,
            2674,
            2708,
            2743,
            2778,
            2813,
            2849,
            2884,
            2919,
            2954,
            2989,
            3023,
            3057,
            3091,
            3124,
            3156,
            3188,
            3218,
            3248,
            3277,
            3305,
            3332,
            3358,
            3382,
            3406,
            3428,
            3449,
            3468,
            3486,
            3503,
            3518,
            3531,
            3543,
            3554,
            3563,
            3570,
            3576,
            3580,
            3583,
            3583,
            3583,
            3581,
            3577,
            3571,
            3565,
            3556,
            3546,
            3535,
            3522,
            3508,
            3493,
            3476,
            3458,
            3439,
            3418,
            3397,
            3374,
            3351,
            3326,
            3301,
            3275,
            3248,
            3221,
            3193,
            3164,
            3135,
            3106,
            3076,
            3046,
            3016,
            2986,
            2956,
            2925,
            2895,
            2866,
            2836,
            2807,
            2778,
            2750,
            2722,
            2695,
            2668,
            2643,
            2618,
            2594,
            2570,
            2548,
            2527,
            2507,
            2487,
            2469,
            2453,
            2437,
            2423,
            2409,
            2398,
            2387,
            2378,
            2370,
            2364,
            2359,
            2355,
            2353,
            2352,
            2352,
            2354,
            2357,
            2362,
            2368,
            2375,
            2383,
            2393,
            2404,
            2416,
            2430,
            2444,
            2460,
            2476,
            2494,
            2513,
            2532,
            2553,
            2574,
            2596,
            2619,
            2642,
            2666,
            2690,
            2715,
            2740,
            2766,
            2792,
            2818,
            2844,
            2871,
            2897,
            2924,
        };
};

#endif /* APPLICATIONS_AD9910_AD9910_RAM_HPP_ */
